package models;

import javax.persistence.Entity;

import play.db.jpa.Model;

@Entity
public class MUser extends Model {
	// for login 
	public String loginName;
	
	public String password;
	// nick
	public String nick;

	public boolean isAdmin;

	public MUser(String loginName, String password, String nick) {
		super();
		this.loginName = loginName;
		this.password = password;
		this.nick = nick;
	}
	
	public static MUser connect(String loginName, String password){
		return find("byLoginNameAndPassword", loginName, password).first();
	}
	
	public String toString(){
		return nick;
	}
}
